import { TokenKey, tenantIdKey, roleKey } from '@/config'
import { lsGet, lsSet } from '@/utils'


export const getTenantid = () => {
  return lsGet(tenantIdKey)
}
export const setTenantid = (tenantId) => {
  lsSet(tenantIdKey, tenantId)
}
export const removeTenantid = () => {
  return lsSet(tenantIdKey, undefined)
}
export const getToken = () => {
  return lsGet(`${TokenKey}${getTenantid()}`)
}
export const setToken = (token) => {
  lsSet(`${TokenKey}${getTenantid()}`, token)
}
export const removeToken = () => {
  return lsSet(`${TokenKey}${getTenantid()}`, undefined)
}
export const getRole = () => {
  return lsGet(`${roleKey}${getToken()}`)
}
export const setRole = (role) => {
  lsSet(`${roleKey}${getToken()}`, role)
}
export const removeRole = () => {
  return lsSet(`${roleKey}${getToken()}`, undefined)
}
// roleKey